package com.tjetc.view.impl;

import com.tjetc.constant.CommonConstant;
import com.tjetc.context.BaseContext;
import com.tjetc.controller.AdminController;
import com.tjetc.utils.ScannerUtils;
import com.tjetc.view.AdminPage;
import com.tjetc.view.AdminLoginPage;
import com.tjetc.view.CommentPage;
import com.tjetc.view.CommonPage;

/**
 * @Author: itda
 * @Date: 2024/5/9 13:28
 * @Description: AdminPageImpl
 */
public class AdminPageImpl implements AdminPage {

    private AdminController adminController = new AdminController();

    private AdminLoginPage adminLoginPage = new AdminLoginPageImpl();

    private CommonPage commonPage = new CommonPageImpl();

    @Override
    public void show() {
        while (true) {
            System.out.println("管理员页面");
            System.out.println("1.登录");
            System.out.println("2.酒店信息管理");
            System.out.println("3.房间预约管理");
            System.out.println("4.房间状态管理");
            System.out.println("5.支付管理");
            System.out.println("6.订单管理");
            System.out.println("7.办理入住");
            System.out.println("8.办理退房");
            System.out.println("9.评价与评论管理");
            System.out.println("10.报表和分析");
            System.out.println("11.返回");
            switch (ScannerUtils.sc.nextInt()) {
                case 1 -> adminController.login(adminLoginPage.login());
                case 2 -> adminController.info();
                case 3 -> adminController.reserve();
                case 4 -> adminController.status();
                case 5 -> adminController.payment();
                case 6 -> adminController.order();
                case 7 -> adminController.checkIn(commonPage.checkIn());
                case 8 -> adminController.checkOut(commonPage.checkOut());
                case 9 -> adminController.comment();
                case 10 -> adminController.statistics();
                case 11 -> {
                    BaseContext.removeCurrentId();
                    return;
                }
                default -> System.out.println(CommonConstant.COMMAND_ERROR);
            }
        }
    }

}
